package com.lyx.springmvc.service;

import com.lyx.springmvc.dao.UserDAO;
import com.lyx.springmvc.pojo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class UserService {
    @Resource
    private UserDAO userDAO;
    public User getUser(String username, String password){
        User user = userDAO.getUser(username, password);
        return user;
    }
    public boolean getUserForm(User user){
        List<User> userList = userDAO.getUserByForm(user);
        if(userList!=null&&userList.size()>0){
            return true;
        }
        return false;
    }
    public boolean insert(User user){
        int insert = userDAO.insert(user);
        if(insert==0){
            return false;
        }
        return true;
    }

}
